<?php

namespace app\admin\controller;

use think\Controller;
use think\Request;
use app\admin\model\SiftArt as ModelSiftArt;

class SiftArt extends Controller
{
    public function edit(){
        //修改数据
        if (request()->isPost()) {
            $data = input('post.');
            $article = new ModelSiftArt();
            $save = $article->update($data);
            if ($save) {
                $this->success('修改文章成功','edit');
            }else{
                $this->error('修改文章失败');
            }
            return;
        }
        $res = ModelSiftArt::find();
        $this->assign('sift_art', $res);
        return view();
    }
}
